<template>
	<view :style="$s.view_color">
		<my-navbar :name="nav_title"></my-navbar>
		<view class="list-box">
			<view class="li" v-for="(item,index) in list" :key="index">
				<view class="lt">
					<view class="l-name">
						<text class="read">订单号：{{item.order_sn}}</text>
					</view>
					<view class="l-val">{{item.create_time}}</view>
				</view>
				<view class="rt">
					<view>{{item.agent_level}}级提成：{{item.agent_fee}}元</view>
				</view>
			</view>
		</view>
		
		<u-loadmore :status="page_status" marginBottom="200" :line="true"/>
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	import uPage from '@/common/page';
	import loginCheck from '@/mixins/loginCheck.js'
	export default {
		mixins:[loginCheck],
		components:{
		},
		data() {
			return {
				nav_title:'佣金明细',
				list:[],
				page_status:"loadmore",
				page_data:{},
			}
		},
		onLoad(){
						
		},
		onShow(){
			this.initData()
		},
		computed:{
			...mapState({
			})
		},
		methods: {
			initData(){
				this.getList();
			},
			// 消息列表
			getList(page={}){
				if(this.page_data.end){
					return;
				}else{
					this.page_status='loading';
				}
				
				uni.$u.api.feeList({page:page.number || 1}).then(res=>{
					this.list = this.list.concat(res.data.list);
					// 分页
					this.page_data=uPage.setData(res.data);
					this.page_status=this.page_data.load;
				});
			},
		},
		onReachBottom() {
			this.getList(this.page_data);
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #efefef;
	}
	.list-box{
		background-color: #FFF;
		border-top: 1px solid $u-border-color;
		.list-head{
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx;
			border-bottom: 1px solid $u-border-color;
			.list-title{
				align-items: center;
				font-weight: 700;
				font-size: 34rpx;
				line-height: 32rpx;
				margin-right: 20rpx;
			}
		}
	}
	.li{
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		align-items: center;
		border-bottom: 1px solid $u-border-color;
		padding: 20rpx 30rpx;
		
		.lt{
			display: flex;
			flex-direction: column;
			text-align: left;
			justify-content: flex-start;
			.l-name{
				width: 400rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				font-size: 28rpx;
			}
			.l-val{
				color: #c6c6c6;
				font-size: 26rpx;
			}
		}
		.rt{
			display: flex;
			flex-direction: column;
			text-align: right;
			justify-content: flex-end;
			align-items: center;
			font-size: 28rpx;
		}
	}
</style>